/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.globussoft.util;
import java.net.*;

/**
 *
 * @author Globussoft
 */
public class ComputerNameAndAddress {

    public static String getComputerName() {
        String ComputerName = "";
        try {
            ComputerName = InetAddress.getLocalHost().getHostName();
        } catch (Exception e) {
            System.out.println("Exception caught =" + e.getMessage());
        }
        return ComputerName;
    }

    public static String getIPAddress() {
        String IPAddress = "";
        try {
            IPAddress = InetAddress.getLocalHost().getHostAddress();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return IPAddress;
    }
}
